<html>
<head>
<script type="text/javascript">

// will be called each time a module is loaded
function mycallback(info) {

    // the info object contains the follow:
    //      name:      The name of the module
    //      version:   The version in use
    //      build:     The build number in use
    //      versions:  An array containing the info for all versions of the module that were 
    //                 registered.  This can help identify issues that were the result of 
    //                 multiple versions of a module on the page.
    //      builds:    All builds that were registered.
    //      mainClass: An object that was was stamped with the current version and build. 
    //                 If mainClass.VERSION != version or mainClass.BUILD != build,
    //                 multiple versions of pieces of the library have been loaded, 
    //                 potentially causing issues.
 
    //document.getElementById("loadedoutput").innerHTML += info.name + " loaded <br />";

    // once the logger is on the page we can get to work
    if (info.name == "logger") {
        YAHOO.widget.Logger.enableBrowserConsole() 
        var l = new YAHOO.widget.LogWriter("(");

        YAHOO.example.EnvTest = function() {
            function log(msg,cat) {
                var c=c||"info";
                YAHOO.log(msg,c,"EnvTest");
            }

            return { 
                init: function() {
                    new YAHOO.widget.LogReader("logoutput");
                    log("init ");
                    log("ie " + YAHOO.env.ua.ie);
                    log("opera " + YAHOO.env.ua.opera);
                    log("webkit " + YAHOO.env.ua.webkit);
                    log("gecko " + YAHOO.env.ua.gecko);
                    log("mobile " + YAHOO.env.ua.mobile);
                    log("secure " + YAHOO.env.ua.secure);
                    log("os " + YAHOO.env.ua.os);
                    log("caja " + YAHOO.env.ua.caja);
                    log("air " + YAHOO.env.ua.air);
                    log("mobile " + YAHOO.env.ua.mobile);
                },
                
                showInfo: function(e, module){
                    // YAHOO.env.getVersion returns the same data
                    // object that YAHOO_config.listener receives
                    var info = YAHOO.env.getVersion(module);

                    log("name: " + info.name);
                    log("version: " + info.version);
                    log("build: " + info.build);
                    log("versions: " + info.versions);
                    log("builds: " + info.builds);
                    log("mainClass version: " + info.mainClass.VERSION);
                }


            };
        } ();

        YAHOO.util.Event.addListener(window, "load", YAHOO.example.EnvTest.init);
        YAHOO.util.Event.addListener("showeventbutton", "click", YAHOO.example.EnvTest.showInfo, "event");
    }
}

YAHOO_config = {
    listener: mycallback
};

</script>
<script src = "../../build/yahoo/yahoo.js" ></script>
<script src = "../../build/event/event.js" ></script>
<script src = "../../build/dom/dom.js" ></script>
<script src = "../../build/dragdrop/dragdrop.js" ></script>
<script src = "../../build/logger/logger.js" ></script>
<link rel="stylesheet" type="text/css" href="../../build/logger/assets/logger.css">
<style> #logoutput {float: right}</style>
</head>
<body>
<div id="logoutput"></div>
<div id="loadedoutput"></div>
<input type="button" id="showeventbutton" value="show event version" />
</body>
</html>
